import request from '@/utils/request'

// 获取面试文章列表
export const getArticles = params => {
  return request({
    method: 'GET',
    url: '/tags',
    params
  })
}

// 发起添加新文章的请求
export const addArticle = data => {
  return request({
    method: 'POST',
    url: '/tags',
    data
  })
}

// 发起删除文章的请求
export const deleteArticle = id => {
  return request({
    method: 'DELETE',
    url: `/tags/${id}`
  })
}

// 文章状态的请求
export const startUserings = data => {
  return request({
    method: 'POST',
    url: `/tags/${data.id}/${data.state}`,
    data
  })
}

// 获取下拉菜单
export const pullDown = subjectName => {
  return request({
    method: 'GET',
    url: '/subjects/simple',
    subjectName
  })
}

// 发起修改的请求
export const editSub = data => {
  return request({
    method: 'PUT',
    url: `/tags/${data.id}`,
    data
  })
}
